from sqlalchemy import Column, ForeignKey, Table
from sqlalchemy.dialects.postgresql import UUID

from app.db.base_class import Base


# class LinkUserGroup(Base):
#     __tablename__ = "link_user_group"
#
#     user_id = Column(UUID(as_uuid=True), ForeignKey("user.id"), primary_key=True)
#     group_id = Column(UUID(as_uuid=True), ForeignKey("group.id"), primary_key=True)

# 多对多关系的关联表
user_group_association = Table(
    'link_user_group', Base.metadata,
    Column('user_id', UUID(as_uuid=True), ForeignKey('user.id'), primary_key=True),
    Column('group_id', UUID(as_uuid=True), ForeignKey('group.id'), primary_key=True)
)
